package IOtest;
import java.io.FileOutputStream;
import java.io.OutputStream;
public class test3 {
    public static void main(String[] args) throws Exception {
        //创建字节输出流并指定目标文件名称
        OutputStream out = new FileOutputStream("C:\\Users\\W\\Desktop\\JavaCode0ofIDEA\\IOtest\\file\\test02.txt");
        String str="黑马程序员";
        byte[] b=str.getBytes();
        out.write(b);
        out.close();
        OutputStream out2 = new FileOutputStream("C:\\Users\\W\\Desktop\\JavaCode0ofIDEA\\IOtest\\file\\test02.txt",true);
        byte[] b2=",欢迎你！".getBytes();
       out2.write(b2);
        out2.close();
    }
}
